package com.kedi.usercenter.controller;

import com.kedi.usercenter.service.ReportService;
import com.kedi.usercenter.utils.ResultVoUtil;
import com.kedi.usercenter.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @Description:    个人权益维护
* @Author:         ytw
* @CreateDate:     2019/8/1 17:17
* @UpdateRemark:   修改内容
* @Version:        1.0
*/
@RestController
public class ReportController {

@Autowired
private ReportService service;

    @PostMapping("/createreport")
    ResultVo updateUserInfo(@RequestParam("type")String type, @RequestParam("content")String content,@RequestParam("puserid")String puserid) {
        HashMap<Object, Object> map = new HashMap<>(10);
        map.put("type", type);
        map.put("content", content);
        map.put("p_user_id",puserid);
        Integer res = service.createReport(map);
      return   ResultVoUtil.success(res);
    }

   @GetMapping("/serchreporttype")
   ResultVo serchreporttype(){
       List<Map<String,Object>> res = service.selectReportType();
       return   ResultVoUtil.success(res);
   }
}
